package com.coin.exchange.otcbtc.api;

/**
 * OTCBTC Auth Api
 * @author duyuchong
 *
 */
public interface OtcbtcAuthApi {

	/**
	 * Get your profile and accounts info.
	 * @param accessKey(required): Access key.
	 * @throws Exception
	 */
	String getUsers(String accessKey, String apiSecret) throws Exception;
	
	/**
	 * Get your orders, results is paginated.
	 * @param accessKey(required): Access key.
	 * @param market(required): Unique market id.
	 * @param state: Filter order by state, default to ‘wait’ (active orders). Other options:‘cancel’, ‘done’
	 * @param limit: Limit the number of returned price levels. Default to 100.
	 * @param page: Specify the page of paginated results. Default value: 1
	 * @param orderBy: If set, returned trades will be sorted in specific order, default to 'asc’.
	 * @return
	 * @throws Exception
	 */
	String listOrders(String accessKey, String apiSecret, String market, String state, Integer limit, Integer page, String orderBy) throws Exception;
	
	/**
	 * Get information of specified order.
	 * @param accessKey(required): Access key.
	 * @param orderId(required): Unique order id.
	 * @return
	 * @throws Exception
	 */
	String listOrder(String accessKey, String apiSecret, Long orderId) throws Exception;
	
	/**
	 * Create a Sell/Buy order.
	 * @param accessKey(required): Access key.
	 * @param market(required): Unique market id.
	 * @param side(required): Either ‘sell’ or 'buy’.
	 * @param volume(required): The amount user want to sell/buy.
	 * @param price: Price for each unit. e.g. If you want to sell/buy 1 otb at 0.002 ETH, the price is ‘0.002’.
	 * @param ordType: Type of order, now only 'limit'.
	 * @return
	 * @throws Exception
	 */
	String createOrder(String accessKey, String apiSecret, String market, String side, Double volume, Double price, String ordType) throws Exception;
	
	/**
	 * Cancel an order.
	 * @param accessKey(required): Access key.
	 * @param orderId(required): Unique order id.
	 * @return
	 * @throws Exception
	 */
	String cancelOrder(String accessKey, String apiSecret, Long orderId) throws Exception;
	
	/**
	 * Cancel all your orders.
	 * @param accessKey(required): Access key.
	 * @param side: If present, only sell orders (asks) or buy orders (bids) will be canncelled. Vaules: 'sell', 'buy'
	 * @return
	 * @throws Exception
	 */
	String cancelOrders(String accessKey, String apiSecret, String side) throws Exception;
	
	/**
	 *  Get your executed trades. Trades are sorted in reverse creation order.
	 * @param accessKey(required): Access key.
	 * @param market(required): Unique market id.
	 * @param limit: Limit the number of returned trades. Default to 50. Range 1..1000
	 * @param timestamp: An integer represents the seconds elapsed since Unix epoch. If set, only trades executed before the time will be returned.
	 * @param from: Trade id. If set, only trades created after the trade will be returned.
	 * @param to: Trade id. If set, only trades created before the trade will be returned.
	 * @param orderBy: If set, returned trades will be sorted in specific order, default to 'desc'. Values: 'asc', 'desc'
	 * @return
	 * @throws Exception
	 */
	String getMyTrades(String accessKey, String apiSecret, String market, Integer limit, Long timestamp, String from, String to, String orderBy) throws Exception;
	
}
